<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<%@include file="/white/common/common.jsp"%>
<%@include file="/white/common/taglibs.jsp"%>
<html>
<head>
<script type="text/javascript">
        <!--
        function submitForm(){
            var searchForm=document.getElementById("searchForm");
            searchForm.submit();
        }
        
        function notAllowedLockSelf(id){           
            var searchForm=document.getElementById("searchForm");
            searchForm.action="userAction-"+id+"!lock.action";
            searchForm.submit();            
        }
        
        function validateModify(){        	
        	var check = document.getElementsByName("selectedIds");
        	var a = 0;
            var id;
           
            for(var i=0;i <check.length;i++){
                if(check[i].checked==true){
                    a++;
                    id = check[i].value;
                }
            }
            
            if(a == 1){            	
            	var searchForm=document.getElementById("searchForm");
            	searchForm.action="userInfoAction-"+id+"!toEdit.action";
            	searchForm.submit();
                return true;
            }else{
                alert("请选择一条记录");
                return false;
            }
        }        
        
        function validateDelete(){
            var check=document.getElementsByName("selectedIds");
            var a=false;
            for(var i=0;i <check.length;i++){
                if(check[i].checked==true){
                    a=true;
                    break;
                }
            }
            if(a){
                return confirm('你确定所选内容');
            }else{
                alert("请先择你要删除的内容!!");
                return false;
            }
        }

        function doDelete(){
            var searchForm=document.getElementById("searchForm");
            searchForm.action='userInfoAction!delete.action';
            searchForm.submit();
            return true;
        }
        
        function displayResult(){
            var result = "<s:property value='result'/>";
            if(result != null && result != ""){
                alert(result);
            }
        }    
                        function excel(){
            var searchForm=document.getElementById("searchForm");
            searchForm.action='userInfoAction!exportExcel.action';
            searchForm.submit();       
            }
                          function downloadexcel(){
   var searchForm=document.getElementById("searchForm");
            searchForm.target="";
            searchForm.action='userInfoAction!downloadexcel.action';         
            searchForm.submit();
            }  
    //-->
    </script>
</head>
<body onload="displayResult()">
	<s:form method="post" action="userInfoAction!queryByPage.action"
		theme="simple" id="searchForm">
		<div id="div_title">
			<h3>
				<%-- ${classDisplayName}浏览: user_info --%>
				用户信息
			</h3>
			<div id="div_search">
				<table>
					<tr>
						<!-- 查询条件 -->
						<td width="80" align="right">客户编号:</td>
						<td><s:textfield name="query_custId" /></td>
						<td width="80" align="right">姓名:</td>
						<td><s:textfield name="query_name" /></td>
						<td width="80" align="right">用户名:</td>
						<td><s:textfield name="query_username" /></td>
						<td width="80" align="right">状态:</td>
						<td><s:textfield name="query_status" /></td>					
					</tr>
					
					<tr>
						<td width="80" align="right">性别:</td>
						<td><s:textfield name="query_sex" /></td>
						<td width="80" align="right">身份证号码:</td>
						<td><s:textfield name="query_pno" /></td>
					    <td width="80" align="right">手机:</td>
						<td><s:textfield name="query_phone" /></td>
						<td width="80" align="right">电话:</td>
						<td><s:textfield name="query_telphone" /></td>						
					</tr>
					
					<tr>
						<td width="80" align="right">邮箱:</td>
						<td><s:textfield name="query_email" /></td>					
						<td width="80" align="right">城市:</td>
						<td><s:textfield name="query_city" /></td>
						<td width="80" align="right">地址:</td>
						<td><s:textfield name="query_adress" /></td>
						<td width="80" align="right">序列号:</td>
						<td><s:textfield name="query_seqno" /></td>
					</tr>
					
					<tr>
						<td width="80" align="right">证书状态:</td>
						<td><s:textfield name="query_certificatetype" /></td>
						<td width="80" align="right">证书代码:</td>
						<td><s:textfield name="query_certificatecode" /></td>
						<td width="80" align="right">最近登录时间:</td>
						<td colspan="4">
						<s:textfield name="query_lastLogin" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd', minDate:'1900-01-01',maxDate:''})"></s:textfield>
						-- <s:textfield name="query_lastLoginend" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd', minDate:'1900-01-01',maxDate:''})"></s:textfield>
						</td>

					</tr>

					<tr>
						<td width="80" align="right">最近登录IP:</td>
						<td><s:textfield name="query_lastIp" /></td>
						<td width="80" align="right">新增渠道:</td>
						<td><s:textfield name="query_addChannel" /></td>
						<td width="80" align="right">用户注册时间:</td>
						<td colspan="4">
						<s:textfield name="query_addTime" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd', minDate:'1900-01-01',maxDate:''})"></s:textfield>
						-- <s:textfield name="query_addTimeend" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd', minDate:'1900-01-01',maxDate:''})"></s:textfield>
						</td>
					</tr>
						<tr>
						<td width="80" align="right"><authz:authorize
							ifAnyGranted="SMOOTH_ALL">
							<s:submit cssClass="submit_search" value="搜索"
								action="userInfoAction!queryByPage" />
						</authz:authorize></td>
					</tr>
				</table>
			</div>
		</div>
		 
		<div id="div_button">
		<!--
			<authz:authorize ifAnyGranted="SMOOTH_ALL">
				<s:submit value="新增"
					onclick="form.action='userInfoAction!toAdd.action';return true;"
					cssClass="input_button" />
			</authz:authorize>
			<authz:authorize ifAnyGranted="SMOOTH_ALL">
				<s:submit value="修改" onclick="return validateModify()"
					cssClass="input_button" />
			</authz:authorize>
			<authz:authorize ifAnyGranted="SMOOTH_ALL">
				<input type="button" value="删除"
					onclick="if(validateDelete()){doDelete()}" class="input_button">
			</authz:authorize>
			-->
			<authz:authorize ifAnyGranted="SMOOTH_ALL">
			<input type="button" cssClass="input_button" value="导出EXCEL" onClick="excel();disabled=true;document.getElementById('searchForm').action='userInfoAction!queryByPage.action';"/>
			 <input type="button" value="下载EXCEL" onClick="downloadexcel();<s:property value="todownload"/>"/> 
			</authz:authorize>
			<%@include file="/white/common/message.jsp"%>
		</div>
		 
		<!--列表 �?�� -->
		<table cellpadding="0" cellspacing="0" class="t_list">
			<tr>
				<th><input type="checkbox" onclick="selectCheckbox();"
					name="checkbox2" value="checkbox" /></th>
				<!--列表头部 -->
				<th>客户编号</th>
				<th>姓名</th>
				<th>用户名</th>
				<th>状态</th>
				<th>性别</th>
				<th>身份证号</th>				
				<th>手机</th>
				<th>电话</th>
				<th>邮箱</th>
				<th>城市</th>
				<th>地址</th>				
				<th>序列号</th>				
				<th>证书状态</th>
				<th>证书代码</th>	
				<th>新增渠道</th>
				<th>用户注册时间</th>						
				<th>最近登录时间</th>
				<th>最近登录IP</th>
			</tr>
			<s:iterator value="resultList" status="sindex">
				<tr>
					<td><input type="checkbox" name="selectedIds"
						value="${ ID }" id="selectedIds" /></td>
					<td><s:property value="CUST_ID" /></td>
					<td><s:property value="NAME" /></td>
					<td><s:property value="USERNAME" /></td>
					<td><s:property value="STATUS" /></td>
					<td><s:property value="SEX" /></td>
					<td><s:property value="PNO" /></td>				
					<td><s:property value="PHONE" /></td>
					<td><s:property value="TELPHONE" /></td>
					<td><s:property value="EMAIL" /></td>
					<td><s:property value="CITY" /></td>
					<td><s:property value="ADRESS" /></td>				
					<td><s:property value="SEQNO" /></td>		
					<td><s:property value="CERTIFICATETYPE" /></td>
					<td><s:property value="CERTIFICATECODE" /></td>
					<td><s:property value="ADD_CHANNEL" /></td>
					<td><s:property value="ADD_TIME" /></td>
					<td><s:property value="LAST_LOGIN" /></td>
					<td><s:property value="LAST_IP" /></td>
				</tr>
			</s:iterator>
		</table>
		<!--列表 结束 -->
		<!--分页 �?�� -->
		<s:if test="resultList.size() > 0">
			<table border="0" cellspacing="0" cellpadding="0" class="t_bottom">
				<tr>
					<td><%@include file="/white/common/pageList.jsp"%></td>
				</tr>
			</table>
		</s:if>
		<!--分页 结束 -->

	</s:form>
</body>
</html>
